﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CMU.Certificates;

namespace CMU.Query
{
    class XuLy
    {
        public string tmp;
        
        CertificateEntities CN = new CertificateEntities();
        public int ThongKe (int idkh, int idmh, int idhk, int idgv)
        {
            List<ChungChi> listcc = new List<ChungChi>();
            var CC = from p in CN.ChungChi.Where(cc => cc.LopHoc.Id_KH == idkh) select p;
            CC=from n in CN.ChungChi.Where(cc => cc.LopHoc.Id_GV == idgv ) select n;
            CC = from l in CN.ChungChi.Where(cc => cc.LopHoc.Id_MH == idmh) select l;
            CC = from m in CN.ChungChi.Where(cc => cc.LopHoc.Id_TG == idkh) select m;
            return CC.Count<ChungChi>();
        }
    }
}
